package com;

import java.io.InputStream;
import java.net.URL;
import java.util.Arrays;

/**
 * @author ：Dsi
 * @date ：2021/11/18 14:55
 * Describe ：
 */
public class GetSourceCode {
    public static void main(String[] args) throws Throwable {
        getSourceCode();
    }

    public static String[] getSourceCode() throws Throwable{
        //String b = "https://pic.netbian.com/4kdongman/";
        String b = "http://www.bilibili.com/read/mobile?id=8671847";
        URL u=new URL(b);
        InputStream i = u.openStream();
        byte[] bytes=new byte[1024*10];
        String[] bos=new String[10];
        for (int j = 0; (i.read(bytes))!=-1; j++) {
            bos[j]=new String(bytes,0,bytes.length);
        }
        i.close();
        System.out.println(Arrays.toString(bos));
        return bos;
    }
}
